home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / TURB_VIS / ALEXLEVI / DEMO / DEMOUSE.C < prev    next >
C/C++ Source or Header  |  1994-04-12  |  4KB  |  90 lines

  1.  
  2. /*
  3.  
  4. ****************************************************************************
  5. *                                                                          *
  6. *     This procedure was made by Alex Levitas' "Mouse Cursor Editor".      *
  7. *                                                                          *
  8. ****************************************************************************
  9.  
  10.  This procedure changes mouse cursor icon in graphic mode.
  11.  
  12.                             W A R N I N G ! ! !
  13.  This procedure DOES NOT check mouse existence, DOES NOT initialize mouse,
  14.  but  ONLY  change icon  of active  initialized  mouse in graphic mode ! !
  15.  
  16.  To use this procedure in your program, insert the directive
  17.  
  18.     #include "DEMOUSE.C"
  19.  
  20.  If you want to use more than one changed icon in your program, you
  21.  must change procedure name in each source file.
  22.  
  23. */
  24.  
  25. #include <dos.h>
  26.  
  27. void ChangeMouseCursor()
  28.  
  29.  {
  30.  
  31.    struct MouseGraphicCursor {
  32.                               unsigned int ScreenMask[16],
  33.                                            CursorMask[16],
  34.                                            HotDotX,
  35.                                            HotDotY;
  36.                              }
  37.                                TheCursor = {
  38.                                             {
  39.                                               57375,
  40.                                               57375,
  41.                                               57375,
  42.                                               49167,
  43.                                               32775,
  44.                                                   3,
  45.                                                   3,
  46.                                                   1,
  47.                                                   3,
  48.                                                   3,
  49.                                               32775,
  50.                                               49167,
  51.                                               57375,
  52.                                               57375,
  53.                                               57375,
  54.                                               65535
  55.                                             },
  56.                                             {
  57.                                                   0,
  58.                                                4032,
  59.                                                4032,
  60.                                                4128,
  61.                                                8464,
  62.                                               16648,
  63.                                               16648,
  64.                                               16652,
  65.                                               16904,
  66.                                               17416,
  67.                                                8208,
  68.                                                4128,
  69.                                                4032,
  70.                                                4032,
  71.                                                   0,
  72.                                                   0
  73.                                             },
  74.                                                 7,
  75.                                                 7
  76.                                            },
  77.                                far *PCursor = &TheCursor;
  78.  
  79.     struct REGPACK Regs;
  80.  
  81.     Regs.r_es=FP_SEG(PCursor);
  82.     Regs.r_dx=FP_OFF(PCursor);
  83.     Regs.r_bx=TheCursor.HotDotX;
  84.     Regs.r_cx=TheCursor.HotDotY;
  85.     Regs.r_ax=9;
  86.     intr(0x33,&Regs);
  87.  
  88. }
  89.  
  90.